<?
/*
 * Plugin Name: Sample P_RokkoMVC Plugin
 * Description: Demonstrates how awesome RokkoMVC is, and how much it simplifies WordPress plugin development, testing, and maintenance.
 * Author: Rodrigo Silveira
 * Author URI: http://www.rodrigo-silveira.com
 * Version: 0.23
 * 
 */

add_action("admin_menu", "loadANPAdmin");


/**************************************************************
 *
**************************************************************/
function loadANPAdmin() {
   add_options_page( "Plugin Main Dashboard",
         "ANP Admin",
         1,
         "rokkomvc_demo_admin",
         "rokkomvc_demo_admin"
   );
    
   wp_enqueue_script("anp_jquery",
         "http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js",
         array("jquery")
   );
}


/**************************************************************
 *
 **************************************************************/
function rokkomvc_demo_admin(){
   global $wpdb;
   
   //
   // Import base application
   //
   require_once __DIR__."/../p_rokkomvc/PRokkoMVC.php";
   require_once __DIR__."/../p_rokkomvc/controllers/PRokkoController.php";
   require_once __DIR__."/../p_rokkomvc/models/PRokkoModel.php";
   
   //
   // Import classes used in this plugin only
   //
   require_once "app/controllers/p_properties.php";
   require_once "app/models/p_property.php";
   
   //
   // Let the core bootstrap handle the request
   //
   PRokkoMVC::run("ANPAdmin", "PProperties", "rokkomvc_demo_admin", __DIR__."/app/controllers", $wpdb, @$_GET["reqName"]);
}
